package wjb.test.mawen.mawen.mapper;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import wjb.test.mawen.mawen.model.User;

@Mapper
public interface UserMapper {
    //插入用户表
    @Insert("insert into user (account_id,name,token,gmt_create,gmt_modified,email) values(#{account_id},#{name},#{token},#{gmt_create},#{gmt_modified},#{email})")
    public void addUser(User user);

    //通过token查询数据库，获取用户对象
    @Select("select * from user where token=#{token}")
    public User findUserByToken(@Param("token") String token);
}
